@extends('admin.app')

@section('content')
  <div class="panel panel-default">
    <div class="panel-heading font-bold">
      融资基本信息
    </div>
    <div class="panel-body">
      @if($info->status=='none')
        <form class="form-horizontal form-validation" action="{{ admin_action('Business\DemandController@check1',[$info]) }}" method="post">
      @elseif($info->status=='check')
        <form class="form-horizontal form-validation" action="{{ admin_action('Business\DemandController@check2',[$info]) }}" method="post">
      @elseif($info->status=='fail')
        <form class="form-horizontal form-validation" action="{{ admin_action('Business\DemandController@cancel',[$info]) }}" method="post">
      @else
        <form class="form-horizontal form-validation" action="{{ admin_action('Business\DemandController@index',[$info]) }}" method="post">
      @endif
        {{ csrf_field() }}
        <div class="form-group">
          <div class="col-sm-2 control-label">融资人</div>
          <div class="col-sm-10">
          	<p class="form-control-static">{{$info->financier_name}}</p>
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <div class="col-sm-2 control-label">融资标题</div>
          <div class="col-sm-10">
          	<p class="form-control-static">{{$info->projects_name}}</p>
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <div class="col-sm-2 control-label">融资金额</div>
          <div class="col-sm-10">
          	<p class="form-control-static">{{$info->finance_money}}</p>
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <div class="col-sm-2 control-label">状态</div>
          <div class="col-sm-10">
            <p class="form-control-static">{{$info->status()->name??''}}</p>
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <div class="col-sm-2 control-label">是否新手标</div>
          <div class="col-sm-10" onselectstart="return false;">
            <p class="form-control-static">{{$info->new_projects?'是':'否'}}</p>
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <div class="col-sm-2 control-label">是否自动发布公告</div>
          <div class="col-sm-10" onselectstart="return false;">
            <p class="form-control-static">{{$info->is_notice?'是':'否'}}</p>
            @if($info->is_notice)
            <p class="form-control-static">发布时间：{{$info->notice_time}}</p>
            <p class="form-control-static">会在项目发布时自动生成一条公告信息</p>
            @endif
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <div class="col-sm-2 control-label">是否参加风险备付金计划</div>
          <div class="col-sm-10" onselectstart="return false;">
          	<p class="form-control-static">{{$info->is_plan?'是':'否'}}</p>
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <div class="col-sm-2 control-label">是否使用红包</div>
          <div class="col-sm-10" onselectstart="return false;">
            <p class="form-control-static">{{$info->gift_check?'是':'否'}}</p>
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <div class="col-sm-2 control-label">是否累计使用红包</div>
          <div class="col-sm-10" onselectstart="return false;">
            <p class="form-control-static">{{$info->gift_money_auto?'是':'否'}}</p>
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <div class="col-sm-2 control-label">红包分类</div>
          <div class="col-sm-10">
          	<p class="form-control-static">{{ $info->gift_cate }}</p>
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="disable-input">
          <div class="form-group">
            <div class="col-sm-2 control-label">融资期限</div>
            <div class="col-sm-2">
          		<p class="form-control-static">
                <?php echo $info->finance_time_num; if($info->finance_time_cate=='m'){echo '个月';}?>
                <?php if($info->finance_time_cate=='d'){echo '天';}?>
                <?php if($info->finance_time_cate=='mm'){echo '自然月';}?>
              </p>
            </div>
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <div class="col-sm-2 control-label">满标条件</div>
          <div class="col-sm-10">
            <p class="form-control-static"><?php 
              if($info->full_code=='pc'){echo '固定比例。'.$info->full_num.'%';}else
              if($info->full_code=='time'){echo '固定时间。'.$info->full_num;}
              else{echo '固定金额。'.$info->full_num.'元';}?>
            </p>
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <div class="col-sm-2 control-label">起投金额</div>
          <div class="col-sm-4">
        		<p class="form-control-static">{{$info->finance_rule_money}}</p>
          </div>
        	<div class="col-sm-2 control-label">是否为起投金额的倍数</div>
          <div class="col-sm-2">
        		<p class="form-control-static">{{$info->finance_rule_fold?'是':'否'}}</p>
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <label class="col-lg-2 control-label">投资时间</label>
          <div class="col-lg-5">
      			<p class="form-control-static">{{$info->start_time}}--{{$info->end_time}}</p>
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <div class="col-sm-2 control-label">项目类型</div>
          <div class="col-sm-10">
            <p class="form-control-static">{{$info->type()->name}}</p>
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <label class="col-lg-2 control-label">属性</label>
          <div class="col-sm-10">
            @foreach($type_attr as $item)
            <p class="form-control-static">
              <span class="text-success">{{$item->attr_name}}</span>
              @if($item->cate==1 && $item->content)
              @foreach(json_decode($item->content) as $img)
              <div>
                <img src="{{asset($img->full_url)}}" alt="" width="270" height="150"/>
                <span>{{$img->filename}}</span>
              </div>
              @endforeach
              @else
              {!!$item->content!!}
              @endif
            </p>
            @endforeach
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <div class="col-sm-2 control-label">分润信息</div>
          <div class="col-sm-10">
      			<p class="form-control-static">{{$info->profits()->name??''}}</p>
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <label class="col-lg-2 control-label">收益展示</label>
          <div class="col-sm-5" id="profits_stage_one">
          	@foreach($modes as $item)
          	@if($item->stage=='profits_stage_one')
          	<p class="form-control-static">
          		{{$item->stage()->name.$item->role()->name}}
          		<span class="text-danger">{{$item->scale}}</span>%
          	</p>
          	@endif
          	@endforeach
          </div>
          <div class="col-sm-5" id="profits_stage_two">
          	@foreach($modes as $item)
          	@if($item->stage=='profits_stage_two')
          	<p class="form-control-static">
          		{{$item->stage()->name.$item->role()->name}}
          		<span class="text-danger">{{$item->scale}}</span>%
          	</p>
          	@endif
          	@endforeach
          </div>
          <p class="col-sm-offset-2 col-sm-12 form-control-static">
            融资成本利率：<span class="text-danger" id="scale-total">{{$modes->total}}</span>%
          </p>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <div class="col-sm-2 control-label">担保合同</div>
          <div class="col-sm-10">
            <p class="form-control-static">{{$info->template($info->collateral_tmp)->title??''}}
              <a style="color:red" class="blue" href="{{ action('UserCenter\UserCenterController@printTemplate',[$info->id]) }}" target="_bank">打印合同</a>
            </p>
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <label class="col-lg-2 control-label">三方担保机构</label>
          <div class="col-sm-10">
            <p class="form-control-static">{{$info->collateralUser()->username??''}}</p>
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <div class="col-sm-2 control-label">三方机构类型</div>
          <div class="col-sm-10">
            <p class="form-control-static">{{$info->collateralType()->name??''}}</p>
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <label class="col-lg-2 control-label">收益展示</label>
          <div class="col-sm-10">
            <p class="form-control-static">{{$info->auto_rate}}</p>
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <div class="col-sm-2 control-label">担保合同号</div>
          <div class="col-sm-10">
            <p class="form-control-static">{{$info->collateral_licence_no??''}}</p>
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <div class="col-sm-2 control-label">担保方式</div>
          <div class="col-sm-10">
            <p class="form-control-static">{{$info->collateral()->name??''}}</p>
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <div class="col-lg-4 col-lg-offset-2">
            <a href="{{ admin_action('Business\DemandController@index') }}" class="btn btn-default">返&nbsp;回</a>
            @if($info->status=='none' && $author->hasPermission('POSTadmin/business/check1/{id}'))
            <input type="submit" name="check" class="btn btn-success" value="一级审核通过"/>
            <input type="submit" name="none" class="btn btn-danger" value="不通过审核"/>
            @elseif($info->status=='check' && $author->hasPermission('POSTadmin/business/check2/{id}'))
            <input type="submit" name="rush" class="btn btn-primary" value="二级审核通过"/>
            <input type="submit" name="none" class="btn btn-danger" value="不通过审核"/>
            @elseif($info->status=='fail' && $author->hasPermission('POSTadmin/business/cancel/{id}'))
            <input type="submit" name="back" class="btn btn-danger" value="撤销项目"/>
            @endif
          </div>
        </div>
      </form>
    </div>
  </div>
@endsection